[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+---------------+##########################################################
#+-| SET FILTER TO |-----------------------------------------+################
#| +---------------+ The SET FILTER TO command inserts or |################
#| removes an <L-exp> from the filter list |################
#+-----------------------------------------------------------+################
##############################################################################
##############################################################################
#+--| Syntax |-------------------------------------------+####################
#| [!<Alias>] SET FILTER TO [<L-exp> [ADDITIVE]] |####################
#+-------------------------------------------------------+####################
##############################################################################
##############################################################################
#########+---| Description |-----------------------------------------+########
#########| After the record pointer has been repositioned, the |########
#########| database engine checks the validity of the SET FILTER TO |########
#########| expression. If <L-exp> is FALSE, then the record pointer |########
#########| is repositioned. This process continues until <L-exp> is |########
#########| TRUE or until EOF or BOF is TRUE. |########
#########| --------------------------------------------------------- |########
#########| <L-exp> |########
#########| |########
#########| If <L-exp> is specified, then SKIP, GOTO TOP or GOTO |########
#########| BOTTOM checks the result of <L-exp> before setting the |########
#########| record number. If the result of <L-exp> is FALSE, then |########
#########| each command will SKIP through the alias in the |########
#########| appropriate direction until <L-exp> is TRUE. |########
#########| --------------------------------------------------------- |########
#########| If <L-exp> is not specified, then all filters in the |########
#########| filter list are removed from the alias. |########
#########| This is identical to encoding: |########
#########| |########
#########| SET FILTER TO .T. |########
#########| --------------------------------------------------------- |########
#########| ADDITIVE |########
#########| |########
#########| ADDITIVE tells the FORCE compiler to add the <L-exp> to |########
#########| the filter list of expressions that must evaluate to TRUE |########
#########| for a record to be in the logical database. If ADDITIVE |########
#########| is not specified, then <L-exp> becomes the only filter in |########
#########| the filter list. |########
#########+-----------------------------------------------------------+########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Limit a listing to all songs composed by |#########
#########| * the Beatles. |#########
#########| |#########
#########| OPEN "playlist.dbf" ALIAS radio |#########
#########| SET FILTER TO radio->group = "Beatles" |#########
#########| LIST ALL && Print only songs by |#########
#########| && The Beatles. |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Limit a listing to all songs composed by the |#########
#########| * Beatles and played by an FM radio station. |#########
#########| |#########
#########| OPEN "playlist.dbf" ALIAS radio |#########
#########| SET FILTER TO radio->group = "Beatles" |#########
#########| SET FILTER TO radio->type = "FM" ADDITIVE |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 3 |-------------------------------------------+#########
#########| * Limit a listing to all songs composed by the |#########
#########| * Beatles and played by an FM radio station not in |#########
#########| * California. |#########
#########| |#########
#########| OPEN "playlist.dbf" ALIAS radio |#########
#########| SET FILTER TO radio->group = "Beatles" |#########
#########| SET FILTER TO radio->type = "FM" ADDITIVE |#########
#########| SET FILTER TO radio->state <> "CA" ADDITIVE |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
SET RELATION TO
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson